// 用户相关类型
export interface User {
  id: number;
  user_id?: string;
  username: string;
  email: string;
  full_name?: string;
  is_superuser: boolean;
  disabled?: boolean;
  last_login?: string;
  created_at?: string;
  updated_at?: string;
}

export interface LoginRequest {
  username: string;
  password: string;
}

export interface RegisterRequest {
  username: string;
  email: string;
  password: string;
  full_name?: string;
}

export interface AuthResponse {
  access_token: string;
  token_type: string;
  user: User;
}

// 站点相关类型
export interface Site {
  id: number;
  name: string;
  domain: string;
  url: string;
  status: 'active' | 'inactive' | 'maintenance';
  description?: string;
  user_id: number;
  created_at: string;
  updated_at: string;
}

export interface CreateSiteRequest {
  name: string;
  domain: string;
  url: string;
  status: 'active' | 'inactive' | 'maintenance';
  description?: string;
}

// 证书相关类型
export interface Certificate {
  id: number;
  name: string;
  domain: string;
  issuer: string;
  status: 'valid' | 'expired' | 'pending';
  expires_at: string;
  user_id: number;
  created_at: string;
  updated_at: string;
}

export interface CreateCertificateRequest {
  name: string;
  domain: string;
  issuer: string;
  status: 'valid' | 'expired' | 'pending';
  expires_at: string;
}

// 容器相关类型
export interface Container {
  id: number;
  name: string;
  image: string;
  status: 'running' | 'stopped' | 'error';
  port: string;
  cpu_usage: string;
  memory_usage: string;
  user_id: number;
  created_at: string;
  updated_at: string;
}

export interface CreateContainerRequest {
  name: string;
  image: string;
  status: 'running' | 'stopped' | 'error';
  port: string;
  cpu_usage?: string;
  memory_usage?: string;
}

// 流水线相关类型
export interface Pipeline {
  id: number;
  name: string;
  description?: string;
  status: 'active' | 'inactive';
  user_id: number;
  created_at: string;
  updated_at: string;
}

export interface PipelineRun {
  id: number;
  pipeline_id: number;
  status: 'running' | 'success' | 'failed' | 'pending';
  started_at: string;
  finished_at?: string;
  user_id: number;
  created_at: string;
  updated_at: string;
}

// 统计数据类型
export interface DashboardStats {
  sites_count: number;
  certificates_count: number;
  containers_count: number;
  pipelines_count: number;
  user_info: User;
}

// API响应类型
export interface ApiResponse<T = any> {
  message?: string;
  data?: T;
  error?: string;
}

export interface PaginatedResponse<T> {
  items: T[];
  total: number;
  page: number;
  size: number;
  pages: number;
}

// 表单和UI状态类型
export interface FormState {
  isLoading: boolean;
  error: string | null;
  success: boolean;
}

export interface ModalState {
  isOpen: boolean;
  type: 'create' | 'edit' | 'delete' | null;
  data?: any;
} 